﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Soothe
{
    // 16-hour maximum task
    public class CompletedTask : IComparable<CompletedTask>
    {
        public DateTime TimeStamp { get; private set; }

        public int EstimatedHours { get; private set; }
        public int ActualHours { get; private set; }

        public double Velocity { get; private set; }

        public CompletedTask(DateTime timeStamp, int estimatedHours, int actualHours)
        {
            this.TimeStamp = timeStamp;

            this.EstimatedHours = estimatedHours;
            this.ActualHours = actualHours;

            this.Velocity = estimatedHours / actualHours;
        }

        internal CompletedTask(DateTime timeStamp, double velocity)
        {
            this.TimeStamp = timeStamp;

            this.Velocity = velocity;
        }

        public int CompareTo(CompletedTask other)
        {
            return Math.Sign(this.Velocity - other.Velocity);
        }
    }
}
